import { alova } from '../../request';

/** add user */
export function addUser(data: Api.Manage.UserModel) {
  return alova.Post<null>('/account/create', data);
}

/** update user */
export function updateUser(data: Api.Manage.UserModel) {
  return alova.Post<null>('/account/update', data);
}

/** delete user */
export function deleteUser(id: number) {
  return alova.Post<null>('/account/delete', { id });
}

export function batchDeleteUser(id: number[]) {
  return alova.Post<null>('/account/delete', { id });
}

/** get user paginate */
export function paginateUser(params?: Api.Manage.UserSearchParams) {
  return alova.Get<Api.Manage.UserList>('/account/paginate', { params });
}
